package cn.edu.ecut.se2024.model.supplier_mgmt;

import java.io.Serializable;
import java.util.ArrayList;

@SuppressWarnings("serial")
public class Supplier implements Serializable {  // 供应商类
	private int id;  // 供应商ID
	private String name;  // 供应商名称
	private String type;  // 供应商类型
	private String bank;  // 供应商银行账户
	private ArrayList<SupplierAddress> address;  // 供应商地址
	private ArrayList<SupplierContact> contact;  // 供应商联系人
	
	public Supplier() {
		super();
		this.id = -1;
		this.name = "";
		this.type = "";
		this.bank = "";
		this.address = new ArrayList<SupplierAddress>();
		this.contact = new ArrayList<SupplierContact>();
	}
	
	public Supplier(int id, String name, String type, String bank,
			ArrayList<SupplierAddress> address, ArrayList<SupplierContact> contact) {
		super();
		this.id = id;
		this.name = name;
		this.type = type;
		this.bank = bank;
		this.address = address;
		this.contact = contact;
	}

	// 构造一个包含默认空地址和默认空联系人的供应商类对象
	public Supplier(boolean defaults) {
		this();
		SupplierAddress sa = new SupplierAddress();
		sa.setDefaults(defaults);
		SupplierContact sc = new SupplierContact();
		sc.setDefaults(defaults);
		this.address.add(sa);
		this.contact.add(sc);
	}
	
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getType() {
		return type;
	}
	public void setType(String type) {
		this.type = type;
	}
	public String getBank() {
		return bank;
	}
	public void setBank(String bank) {
		this.bank = bank;
	}
	public ArrayList<SupplierAddress> getAddress() {
		return address;
	}
	public void setAddress(ArrayList<SupplierAddress> address) {
		this.address = address;
	}
	public ArrayList<SupplierContact> getContact() {
		return contact;
	}
	public void setContact(ArrayList<SupplierContact> contact) {
		this.contact = contact;
	}
}
